#!/usr/bin/python

# -*- coding: iso-8859-1 -*-

from sqlalchemy import *
from connectionfactory import *

class SqlAlchemyUtils:

    file = 'sqlite:///todo.db'
    debug = True

    def __init__(self):
        self.cf = ConnectionFactory(self.file, self.debug)
        self.con = self.cf.openConnection()

    def createTables(self):
        self.todo = Table('todo', self.cf.metadata,
            Column('id', Integer, primary_key=True),
            Column('descricao',String,nullable=False),
            Column('comentario',String),
            Column('data',Integer,nullable=False),
            Column('importancia',Integer),
        )
        if not self.todo.exists():
            self.todo.create()

        self.todo = Table('todo', self.cf.metadata, autoload=True)

    def createMapper(self):
        #todoMapper = mapper(ClasseDeModelo, tabela)
        pass

    def createExampleData(self):
        pass

    def insert(self):
        pass

    def delete(self):
        pass

    def update(self):
        pass

    def find(self):
        pass

    def list(self):
        pass
        
